home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 2.iso / STUTTGART / LANG / C / LIB / UNIXLIB37B / !UnixLib37 / src / stdio / c / fflush < prev    next >
Text File  |  1996-11-09  |  801b  |  38 lines

  1. /****************************************************************************
  2.  *
  3.  * $Source: /unixb/home/unixlib/source/unixlib37/src/stdio/c/RCS/fflush,v $
  4.  * $Date: 1996/04/19 21:32:42 $
  5.  * $Revision: 1.1 $
  6.  * $State: Rel $
  7.  * $Author: simon $
  8.  *
  9.  * $Log: fflush,v $
  10.  * Revision 1.1  1996/04/19 21:32:42  simon
  11.  * Initial revision
  12.  *
  13.  ***************************************************************************/
  14.  
  15. static const char rcs_id[] = "$Id: fflush,v 1.1 1996/04/19 21:32:42 simon Rel $";
  16.  
  17. #include <stdio.h>
  18.  
  19. __STDIOLIB__
  20.  
  21. int
  22. fflush (register FILE * f)
  23. {
  24.   if (!f)
  25.     {
  26.       register int i;
  27.  
  28.       for (i = 0, f = __iob; i < FOPEN_MAX; i++, f++)
  29.     if (fisopen (f))
  30.       if (fflush (f))
  31.         return (-1);
  32.       return (0);
  33.     }
  34.  
  35.   f->i_cnt = 0;
  36.   return (f->o_base ? __flsbuf (-1, f) : 0);
  37. }
  38.